class Car(val licensePlate: String, val brand: String, val color: String, val price: Double) {  
  
  def drive(): Unit = {  
    println(s"Driving the ${brand} car with license plate ${licensePlate}...")  
  }  
   
  def park(): Unit = {  
    println(s"Parking the ${brand} car with license plate ${licensePlate}...")  
  }  
  
  def refuel(): Unit = {  
    println(s"Refueling the ${brand} car with license plate ${licensePlate}...")  
  }  
}
class ElectricCar(  
  licensePlate: String,  
  brand: String,  
  color: String,  
  price: Double,  
  val batteryCapacity: Double,  
  var rangePerCharge: Double  
) extends Car(licensePlate, brand, color, price) {  
  
 
  def charge(): Unit = {  
 
    rangePerCharge += 50.0  
    println(s"The ${brand} electric car with license plate ${licensePlate} has been charged.")  
  }  
   
}
object CarDemo {  
  def main(args: Array[String]): Unit = {  
   
    val car = new Car("ABC123", "Toyota", "Red", 20000.0)  
    car.drive()  
    car.park()  
    car.refuel()   
   
    val electricCar = new ElectricCar("EV123", "Tesla", "Silver", 50000.0, 100.0, 300.0)  
    electricCar.drive()   
    electricCar.park()   
    electricCar.charge()  
    electricCar.drive()  
    electricCar.drive()  
    electricCar.drive()  
  }  
}
